-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix Inconsistent MultiIndex Sorting #21043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21043 +/- ##
==========================================
- Coverage 91.82% 91.82% -0.01%
==========================================
Files 153 153
Lines 49503 49503
==========================================
- Hits 45458 45457 -1
- Misses 4045 4046 +1
Continue to review full report at Codecov.
|
Just added a test and fix to cover Series as well, as we had another related issue pop up cc @kdebrab |
lgtm. @toobaz if you'd have a quick look. merge if ok. |
thanks @WillAyd very nice! |
Does this need a whatsnew? |
@jorisvandenbossche I can add one. Should I just open a separate PR for that? |
If you think it is needed (if there are user facing changes), then a new PR is perfect |
(cherry picked from commit bc37ea2)
(cherry picked from commit bc37ea2)
closes #20994
closes #20945
closes #21052
git diff upstream/master -u -- "*.py" | flake8 --diff
This is a pretty dark corner and I'll admit that I don't fully understand all of the elements in play. That said, the first problem I noticed with the first referenced issue was an errant conditional that was causing
level=0
andlevel='foo'
to go down two different branches, even if the name of the first level was in fact 'foo'.After uncovering that, the subsequent ordering of the returned index then was incorrect regardless of the argument. I moved a monotonic sort around to fix this, though I feel like:
Feedback appreciated